/*
package com.itheima.aop;


import com.itheima.Mapper.OperateLogMapper;
import com.itheima.anno.LogOperation;
import com.itheima.pojo.OperateLog;
import com.itheima.util.CurrentHolder;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.Arrays;

@Component
@Aspect
@Slf4j
public class OperateLogAspect02 {
    //用于插入数据
    @Autowired
    private OperateLogMapper operateLogMapper;
    */
/***
     * 定义切面类OperationLogAspect，切面类中定义环绕通知@Around
     *//*


    @Around("@annotation(log)")
    public  Object around(ProceedingJoinPoint pjp, LogOperation log)throws Throwable{
        //开始时间
        long start = System.currentTimeMillis();

        */
/**
         * 在@Around中创建日志操作对象，并完善数据（赋值），切入点表达式：execution || @annotation
         * 1）方法信息（方法名字，方法所在类，方法参数，方法返回值，方法执行耗时）
         * 2）操作人（登录系统的用户-JWT令牌）
         *
         *//*

        OperateLog operateLog = new OperateLog();
        operateLog.setOperateEmpId(currentEmpId());
        operateLog.setOperateTime(LocalDateTime.now());
        operateLog.setClassName(pjp.getTarget().getClass().getName());
        operateLog.setMethodName(pjp.getSignature().getName());
        operateLog.setMethodParams(Arrays.toString(pjp.getArgs()));

        //调用目标方法
        Object result = pjp.proceed();

        long end = System.currentTimeMillis();
        operateLog.setCostTime(end-start);

        operateLog.setReturnValue(result.toString());
        operateLogMapper.save(operateLog);

        return result;

    }


    */
/****
     * 获取员工ID
     *//*

    public int currentEmpId(){
        return CurrentHolder.getCurrentId();
    }


}
*/
